<template>
  <div>
    <button class="btn" @click="handleClick">Click Me</button>
    <p>shared count: {{ counterStore.doubleCount }}</p>
  </div>
</template>

<script setup lang="ts">
import { useCounterStore } from '@/stores/counter'

const counterStore = useCounterStore()

const handleClick = () => {
  counterStore.increment()
  console.log('Count:', counterStore.doubleCount)
}
</script>

<style scoped>
.btn {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn:hover {
  background-color: #0056b3;
}
</style>
